<!DOCTYPE html>
<html>
<head>
    <title>考核审批</title>
    <#include "/header.html">
</head>
<body>
<div id="spapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
            <div class="form-group col-sm-2">
                <label>主题:</label>
                <select v-model="q.assessId" placeholder="考核主题"  class="layui-select"  autocomplete="on">
                    <option value="" selected>全部</option>
                    <option :value="a.id" v-for="a in assess" >{{a.title}}</option>
                </select>
            </div>
            <div class="form-group col-sm-2">
                <label>状态:</label>
                <select v-model="q.status"  placeholder="状态" class="layui-select"  autocomplete="on">
                    <option value="1,2,3" selected>全部</option>
                    <option value="1" >已申报未审批</option>
                    <option value="2" >审核通过</option>
                    <option value="3" >审核未通过</option>
                </select>
            </div>
            <a class="btn btn-default" @click="query">查询</a>

            <#if shiro.hasPermission("assess:approval:save")>
            <a class="btn btn-primary" @click="add"><i class="fa fa-pencil-square-o"></i>&nbsp;审批</a>
            </#if>
            <#if shiro.hasPermission("assess:approval:update")>
            <a class="btn btn-primary" @click="edit"><i class="fa fa-plus"></i>&nbsp;修改</a>
            </#if>
            <#if shiro.hasPermission("assess:approval:delete")>
            <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
            </#if>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="layui-row layui-col-space10">
        <div class="layui-col-md6">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3>考核说明</h3>
                </div>
                <div class="panel-body">
                    <ul class="list-group">
                        <li class="list-group-item"><b>考核标题：</b>{{declare.assessSet.title}}</li>
                        <li class="list-group-item"><b>考核总分：</b>{{declare.assessSet.score}}</li>
                        <li class="list-group-item"><b>起始日期：</b>{{declare.assessSet.startDate}}~{{declare.assessSet.endDate}}
                        </li>
                        <li class="list-group-item"><b>评分标准：</b>{{declare.assessSet.standard}}</li>
                        <li class="list-group-item"><b>考核说明：</b>{{declare.assessSet.remark}}</li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="layui-col-md6">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3>考核项说明</h3>
                </div>
                <div class="panel-body">
                    <ul class="list-group">
                        <div v-for="(item, index) in declare.items" :key="index">
                            <li class="list-group-item">
                                <b>{{item.name}}：</b>
                                <b>总分：</b>{{item.totalScore}}
                                <b>评分标准：</b>{{item.standard}}
                            </li>
                        </div>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <div v-show="!showList" class="layui-row layui-col-space10">
        <div class="layui-col-md6">
            <div class="panel panel-default">

                <div class="panel-heading">
                    <h3>员工自评</h3>
                </div>
                <div class="panel-body">
                    <ul class="list-group">
                        <div v-for="(item, index) in declare.declareList" :key="index">
                            <li class="list-group-item">
                                <b>{{item.itemName}}：</b><br/>
                                <b>自评分：</b>{{item.score}}<br/>
                                <b>自评内容：</b>{{item.content}}
                            </li>
                        </div>
                        <li><b>自评总分：</b>{{declare.score}}</li>
                        <li>
                            <b>附件：</b>{{declare.sysFile.name}}
                            <button v-show="!fileFlag" type="button" class="layui-btn" id="downFile"  @click="downFile">下载附件</button>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="layui-col-md6">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3>考核审批</h3>
                </div>
                <div class="panel-body">
                    <form class="form-horizontal">
                        <div class="form-group">
                            <div class="col-sm-2 control-label">审批评分</div>
                            <div class="col-sm-10">
                                <input type="number" v-model="declare.approval.score" name="score" class="layui-input"
                                       autocomplete="off">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-2 control-label">审批状态</div>
                            <div class="col-sm-10">
                                <div class="layui-select-group">
                                    <select name="status" v-model="declare.approval.status" class="layui-select">
                                        <option value="0" selected>通过</option>
                                        <option value="1">未通过</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-2 control-label">审批意见</div>
                            <div class="col-sm-10">
                            <textarea type="text" v-model="declare.approval.comments" name="comments"
                                      class="form-control"></textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-2 control-label"></div>
                            <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
                            &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="${request.contextPath}/statics/js/modules/assess/assessApproval.js?_${.now?long}"></script>
</body>
</html>